
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package desktopapplication1;
import javax.swing.*;

/**
 *
 * @author juliet851123
 */
public class Validering {
    
    
    public Validering()
    {
    }
    
    public boolean selected(JList list)
    {
        if (!list.isSelectionEmpty()){
            return true;
        }
        else{
            return false;
        }
        
    }
    
    public boolean tomtTextField(JTextField textfield){
        if (textfield.getText() == null || textfield.getText().equals("")){
            return false;
        }
        else{
            return true;
        }
    }
    
     public boolean checkLength(String text, int length){
        if (text.length() != length) {
            return false;
        }
        else {
            return true;
        }
}
     
}

